package cn.powertime.evaluation.service.impl;

import cn.powertime.evaluation.Constants;
import cn.powertime.evaluation.entity.CpsQuestionBank;
import cn.powertime.evaluation.mapper.CpsQuestionBankMapper;
import cn.powertime.evaluation.service.CpsQuestionBankService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 题库表 服务实现类
 * </p>
 *
 * @author Yang Xin
 * @since 2019-09-25
 */
@Service
public class CpsQuestionBankServiceImpl extends ServiceImpl<CpsQuestionBankMapper, CpsQuestionBank> implements CpsQuestionBankService {

    @Autowired
    private CpsQuestionBankMapper cpsQuestionBankMapper;

    @Override
    public List<CpsQuestionBank> listAll(int type) {
        QueryWrapper<CpsQuestionBank> qw = new QueryWrapper<>();
        qw.eq("type", type);
        qw.ne("status", Constants.STATUS_DEL);
        return list(qw);
    }

}
